﻿/*-----------------------------------------------------------------------
 * <copyright file="IWCFCommonQuery.svc.cs" company="O-RID">
 *     Copyright (c)2010 O-RID Co.,Ltd.
 * </copyright>
 * <author>Zhang Jun</author>
 * <summary>
 *          WCF 公共查询 服务
 *          一般为公用的查询介面用
 *          作成日：06/24/2010
 *          
 *          04/25/2011  增加 案件名查询信息
 *          06/29/2011  增加 UserOrder（客户种类）查询条件信息。
 *          07/04/2011  增加 ScriptType(帐票种类) 查询条件信息。
 *          07/06/2011  增加 WordType（文字种类）查询条件信息。
 *
 * </summary>
 *---------------------------------------------------------------
 */
namespace Orid.Management.Statistics.Service.OPUnitService.CommonQuery
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Runtime.Serialization;
    using System.ServiceModel;
    using System.Text;
    using System.ServiceModel.Activation;
    using Orid.Management.Statistics.Service.OPUnitService.CommonQuery.ServiceModel;
    using Orid.Management.Statistics.Service.OPUnitService.CommonQuery;
    
    /// <summary>
    /// 注意: 如果更改此处的类名 "WCFCommonQuery"，也必须更新 Web.config 中对 "WCFCommonQuery" 的引用。
    /// </summary>
    [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class WCFCommonQuery : IWCFCommonQuery
    {
        #region 当前SV或SSV的 所有组别
        /// <summary>
        /// 当前SV或SSV的 所有组别
        /// UNIT 公用查询框用
        /// </summary>
        /// <param name="svID">The sv ID.</param>
        /// <param name="svName">Name of the sv.</param>
        /// <returns>返回 当前SV或SSV的所有组别</returns>
        public List<SVUnitDataList> SelSvUnitInfo(string svID, string svName) 
        {
            List<SVUnitDataList> svUnitList = null;
            try
            {
                if (!string.IsNullOrEmpty(svID) || !string.IsNullOrEmpty(svName))
                {
                    svUnitList = DataProvider.GetSelSvUnitInfo(svID.Trim(), svName.Trim());
                }
            }
            catch (Exception ex) 
            {
                Log4Service.Log log = new Orid.Management.Statistics.Service.Log4Service.Log();
                log.Error("WCFCommonQuery SelSvUnitInfo Error:" + ex.Message);
            }

            return svUnitList;
        }
        #endregion 当前SV或SSV的 所有组别

        #region TagInfor
        /// <summary>
        /// TagInfor
        /// 页面上的控件的枚举值
        /// OPEntrySpeedQueryControl.xaml
        /// </summary>
        /// <returns>返回 TagString 的 LIST 形式</returns>
        public List<TagString> TagInfor()
        {
            try
            {
                return DataProvider.GetTagInfor();
            }
            catch (Exception ex)
            {
                Log4Service.Log log = new Orid.Management.Statistics.Service.Log4Service.Log();
                log.Error("WCFCommonQuery TagInfor Error:" + ex.Message);
            }

            return null;
        }
        #endregion TagInfor

        #region 当前SV或SSV的所有OP
        /// <summary>
        /// OP生产 性查询
        /// 当前SV或SSV的所有OP
        /// OPIDlSelectChildWindow.xaml子窗体的
        /// TEXTBOX查询框用
        /// </summary>
        /// <param name="svID">svID sv的ID号</param>
        /// <param name="opIdorName">opIdorName OP的姓名或ID</param>
        /// <returns>返回 SelectOPInforDataList 的 LIST 形式</returns>
        public List<SelectOPInforDataList> SelectSVOPInfor(string svID, string opIdorName)
        {
            try
            {
                return DataProvider.GetSelectSVOPInfor(svID, opIdorName);
            }
            catch (Exception ex)
            {
                Log4Service.Log log = new Orid.Management.Statistics.Service.Log4Service.Log();
                log.Error("WCFCommonQuery SelectSVOPInfor Error:" + ex.Message);
            }

            return null;
        }
        #endregion 当前SV或SSV的所有OP

        #region 取得LINE信息
        /// <summary>
        /// Selects the line infor.
        /// 线路查询信息
        /// </summary>
        /// <returns></returns>
        public List<LineData> SelectLineInfor()
        {
            try
            {
                return DataProvider.GetLineInfor();
            }
            catch (Exception ex)
            {
                Log4Service.Log log = new Orid.Management.Statistics.Service.Log4Service.Log();
                log.Error("WCFCommonQuery SelectLineInfor Error:" + ex.Message);
            }

            return null;
        }
        #endregion 取得LINE信息

        #region 案件名查询信息
        /// <summary>
        /// 案件名查询信息 v2.13
        /// LineSelMatterName.xaml 子窗体用
        /// </summary>
        /// <returns></returns>
        /// <value>04/25/2011 Add </value>
        public List<LineData> SelectMatterNameInfor() 
        {
            try
            {
                return DataProvider.GetMatterNameInfor();
            }
            catch (Exception ex)
            {
                Log4Service.Log log = new Orid.Management.Statistics.Service.Log4Service.Log();
                log.Error("WCFCommonQuery SelectMatterNameInfor Error:" + ex.Message);
            }

            return null;
        }
        #endregion 案件名查询信息

        #region UserOrder（客户种类）查询信息
        /// <summary>
        /// UserOrder（客户种类）查询信息 v2.13
        /// UserOrderSelChildWin.xaml 子窗体用
        /// </summary>
        /// <returns></returns>
        /// <value>06/29/2011 Add </value>
        public List<LineData> SelectUserOrderInfor()
        {
            try
            {
                return DataProvider.GetUserOrderInfor();
            }
            catch (Exception ex)
            {
                Log4Service.Log log = new Orid.Management.Statistics.Service.Log4Service.Log();
                log.Error("WCFCommonQuery SelectUserOrderInfor Error:" + ex.Message);
            }

            return null;
        }
        #endregion UserOrder（客户种类）查询信息

        #region ScriptType(帐票种类) 查询信息
        /// <summary>
        /// ScriptType(帐票种类) 查询信息 v2.14
        /// </summary>
        /// <returns></returns>
        /// <value>07/04/2011 Add </value>
        public List<LineData> SelectScriptTypeInfor() 
        {
            try
            {
                return DataProvider.GetScriptTypeInfor();
            }
            catch (Exception ex)
            {
                Log4Service.Log log = new Orid.Management.Statistics.Service.Log4Service.Log();
                log.Error("WCFCommonQuery SelectScriptTypeInfor Error:" + ex.Message);

            }
            return null;
        }
        #endregion ScriptType(帐票种类) 查询信息

        #region WordType（文字种类）查询条件信息
        /// <summary>
        /// WordType（文字种类）查询条件信息 v2.15
        /// </summary>
        /// <returns></returns>
        /// <value>07/06/2011 Add </value>
        public List<LineData> SelectWordTypeInfor() 
        {
            try
            {
                return DataProvider.GetWordTypeInfor();
            }
            catch (Exception ex)
            {
                Log4Service.Log log = new Orid.Management.Statistics.Service.Log4Service.Log();
                log.Error("WCFCommonQuery SelectWordTypeInfor Error:" + ex.Message);

            }
            return null;
        }
        #endregion WordType（文字种类）查询条件信息

        #region JobClass（JOB种类）查询条件信息
        /// <summary>
        /// JobClass（JOB种类）查询条件信息 v2.15
        /// </summary>
        /// <returns></returns>
        /// <value>07/06/2011 Add </value>
        public List<LineData> SelectJobClassInfor() 
        {
            try
            {
                return DataProvider.GetJobClassInfor();
            }
            catch (Exception ex)
            {
                Log4Service.Log log = new Orid.Management.Statistics.Service.Log4Service.Log();
                log.Error("WCFCommonQuery SelectJobClassInfor Error:" + ex.Message);

            }
            return null;
        }
        #endregion JobClass（JOB种类）查询条件信息

    }
}
